﻿using System.Web.Mvc;
using cludg.Web.ControllerFactory;
using cludg.Web.Core.Bootstrappers;
using cludg.Infrastructure.DI;

namespace cludg.Web.Bootstrappers
{
	public class ControllerFactoryBootstrapper : Bootstrapper
	{
		protected readonly IDIContainer Container;

		public ControllerFactoryBootstrapper(IDIContainer container)
		{
			Container = container;
		}

		public override void Execute()
		{
			ControllerBuilder.Current.SetControllerFactory(Container.Resolve<ControllerFactory.InjectedControllerFactory>());
		}
	}
}